package com.huaxia.day2;

/**
 * 8种基本类型
 */
public class BasicType {

    /**
     * Boolean 型
     */
    private boolean bool0 = false;
    private boolean bool1 = true;

    /**
     * 整型
     */
    private byte aByte = (byte) 1;
    private char aChar = 'a';
    private char bCHar = (char) 64;
    private short aShort = (short) 3569;
    private int anInt = 235546;
    private long aLong = 87870077L;

    /**
     * 浮点型
     */
    private float aFloat = 56.7F;
    private double aDouble = 78.98;


    public static void main(String[] args) {
        t4();
    }

    public static void test0() {
        int Te = 123;
        int a = 0, A = 1;

    }

    /**
     * 边界值问题
     * byte的表示范围是-128 ~~ +127
     * 补码 https://blog.csdn.net/mnv22172/article/details/51420044
     * 实际开发重点关注边界值，确定类型，数据库层也需要关注
     */
    private static void test1() {
        byte a1 = (byte) 120;
        byte a2 = 8;
        System.out.println((byte) (a1 + a2));
    }


    /**
     * 强转
     */
    public static void t1() {
        int age = 12;
        System.out.println("age:" + age);
        long temp = (int) 5.8;
        temp %= 2;
        System.out.println("t1:" + temp);
    }


    public static void t4() {
        int num = 10;
        System.out.println(num++);
        num = num;
        System.out.println(num);
        System.out.println(++num);
    }

}
